package projet.service;

import java.util.List;

import projet.dao.CourseDAOInterface;
import projet.dao.DAOFactoryInterface;
import projet.entity.Course;
import projet.entity.Session;

public class DescriptionService {
	
	public Course getCourse(String code) {
		DAOFactoryInterface daoFactory = DAOUtil.getDAOFactory();
		CourseDAOInterface courseDAO = daoFactory.getCourseDAO();
		
		Course course = courseDAO.getById(code);
		return course;
	}
	
	public List<Session> getSessions(Course course) {
		DAOFactoryInterface daoFactory = DAOUtil.getDAOFactory();
		CourseDAOInterface courseDAO = daoFactory.getCourseDAO();
		
		List<Session> sessions = courseDAO.getSessions(course.getCode());
		return sessions;
	}
	
	public List<Session> getSessionsFuture(Course course) {
		DAOFactoryInterface daoFactory = DAOUtil.getDAOFactory();
		CourseDAOInterface courseDAO = daoFactory.getCourseDAO();
		
		List<Session> sessions = courseDAO.getSessionsFuture(course.getCode());
		return sessions;
	}

}
